<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>修改元素节点</title>
    <script type="text/javascript">
        function method01(){
            //创建修改后的标签
            var spanElement=document.createElement('span');
            spanElement.innerHTML='我是span03';
            //把标签修改到html文件里
            var fatherElement=document.getElementById('father');
            var div03Element=document.getElementById('div03');
            fatherElement.replaceChild(spanElement,div03Element);
        }
    </script>
</head>
<body>
<div id="father">
    <div>我是div01</div>
    <div>我是div02</div>
    <div id="div03">我是div03</div>
    <div>我是div04</div>
    <div>我是div05</div>
    <div>我是div06</div>
</div>
<button onclick="method01()">修改元素节点</button>
</body>
</html>